//
//  HMShopViewController.m
//  G05爱鲜蜂
//
//  Created by 曹魏 on 16/10/20.
//  Copyright © 2016年 何源. All rights reserved.
//
#import "HMUITableView.h"
#import "ListCell.h"

@interface HMUITableView ()<UITableViewDelegate,UITableViewDataSource>

@end

@implementation HMUITableView

-(instancetype)init {
    self = [super init];
    if (self) {
        UINib *nib = [UINib nibWithNibName:@"ListCell" bundle:nil];
        [self registerNib:nib forCellReuseIdentifier:@"ListCell"];
        UINib *nib1 = [UINib nibWithNibName:@"ListCell1" bundle:nil];
        [self registerNib:nib1 forCellReuseIdentifier:@"ListCell1"];
        UINib *nib2 = [UINib nibWithNibName:@"ListCell2" bundle:nil];
        [self registerNib:nib2 forCellReuseIdentifier:@"ListCell2"];
        UINib *nib3 = [UINib nibWithNibName:@"ListCell3" bundle:nil];
        [self registerNib:nib3 forCellReuseIdentifier:@"ListCell3"];
        UINib *nib4 = [UINib nibWithNibName:@"ListCell4" bundle:nil];
        [self registerNib:nib4 forCellReuseIdentifier:@"ListCell4"];
        
        
        self.tableFooterView = [[UIView alloc]init];
        
        self.estimatedRowHeight = 20;
        self.rowHeight = UITableViewAutomaticDimension;
        
        self.delegate = self;
        self.dataSource = self;
}
    
    return self;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 10;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    switch (indexPath.row) {
        case 0:
        {
            ListCell *cell = [ListCell settingCell:tableView withIdentifier:@"ListCell" indexPath:indexPath];
            return cell;
        }
        case 1:
        {
            ListCell *cell = [ListCell settingCell:tableView withIdentifier:@"ListCell1" indexPath:indexPath];
            return cell;
        }
        case 2:
        {
            ListCell *cell = [ListCell settingCell:tableView withIdentifier:@"ListCell2" indexPath:indexPath];
            return cell;
        }
        case 3:
        {
            ListCell *cell = [ListCell settingCell:tableView withIdentifier:@"ListCell3" indexPath:indexPath];
            return cell;
        }
        default:
        {
            ListCell *cell = [ListCell settingCell:tableView withIdentifier:@"ListCell4" indexPath:indexPath];
            return cell;
        }
            
            
    }
}

@end
